package com.example.boot6rabbitmqalipay.listener;

import com.example.boot6rabbitmqalipay.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MessageListener {

    @Autowired
    OrderService orderService;

    @RabbitListener(queues = "jack.message.response")
    public void process(final String result) {
        log.info("=============接收到余额宝转账成功的应答消息=============" + result);
        orderService.updateMessage(result);
    }
}
